import request from '@/utils/request'

// 查询采集文章列表
export function listSpiderArticle(query) {
  return request({
    url: '/article/spiderArticle/list',
    method: 'get',
    params: query
  })
}

// 查询采集文章详细
export function getSpiderArticle(id) {
  return request({
    url: '/article/spiderArticle/' + id,
    method: 'get'
  })
}
// 查询采集分类
export function spiderClassSelect() {
  return request({
    url: '/article/diySpider/getSpiderClassTreeData',
    method: 'get'
  })
}
// 新增采集文章
export function addSpiderArticle(data) {
  return request({
    url: '/article/spiderArticle',
    method: 'post',
    data: data
  })
}


// 修改采集文章
export function updateSpiderArticle(data) {
  return request({
    url: '/article/spiderArticle',
    method: 'put',
    data: data
  })
}

// 删除采集文章
export function delSpiderArticle(id) {
  return request({
    url: '/article/spiderArticle/' + id,
    method: 'delete'
  })
}

// 检测是否可用
export function removeAll() {
  return request({
    url: '/article/spiderArticle/deleteAll/',
    method: 'delete'
  })
}
  // 查询采集规则
  export function spiderDiySelect() {
    return request({
      url: '/article/spiderArticle/getSpiderDiy',
      method: 'get'
    })
  }

// 查询采集来源
export function spiderItemSelect() {
  return request({
    url: '/article/diySpider/getSpiderItem',
    method: 'get'
  })
}

// 查询生成模型
export function PromptsSelect() {
  return request({
    url: '/article/diySpider/getPromptsItem',
    method: 'get'
  })
}


// 全量洗稿
export function startXigaoAll(query,genPs) {
  query.genPs = genPs;
  console.log(query)
  return request({
    url: '/article/spiderArticle/startXigaoAll/',
    method: 'post',
    data: query
  })
}



// 执行洗稿
export function toStartXigao(id,genPs) {
  genPs.ids = id;
  console.log(genPs)
  return request({
    url: '/article/spiderArticle/startXigao',
    method: 'post',
    data: genPs
  })

}

// 生成文章
export function genArticleByGpt(data) {
  return request({
    url: '/article/spiderArticle/genArticleByGpt',
    method: 'post',
    data: data
  })
}

// 检测是否可用
export function checkConnet() {
  return request({
    url: '/article/spiderArticle/checkConnet/',
    method: 'get'
  })
}



// export function getConfi() {
//   return "localhost"
// }
